package yawning.mew.gui.tools;

import yawning.mew.character.Glyph;
import yawning.mew.character.Toon;

public class GlyphWrapper 
{
	private Toon toon;
	private Glyph glyph;
	
	public GlyphWrapper(Glyph glyph,Toon toon)
	{
		this.glyph = glyph;
		this.toon = toon;
		
	}
	
	public boolean setSelected(boolean value)
	{
		if(value)
		{
			if(isSelected()==false)
			{
				return toon.addGlyph(glyph);
			}
		}else
		{
			if(isSelected())
			{
				toon.removeGlyph(glyph);
				return value;
			}
		}
		return !value;
		
	}
	
	public String getName(){return glyph.toString();}
	public int getId(){return glyph.getGlyphId();}
	public String getDescription(){return glyph.getDescription();};
	public String getTypeName(){return glyph.getType().toString();}
	public boolean isSelected()
	{
		return toon.hasGlyph(glyph);
	}
}
